#ifndef LEVELLOADER_H
#define LEVELLOADER_H

#include <string>
#include <fstream>
#include <vector>

#include <boost\shared_ptr.hpp>
#include "Point.h"

#include "GlobalVariables.h"

using namespace std;

class LevelLoader
{
public:	

	LevelLoader(int level);	//Constructor

	//! \briefReturns map data in the required format
	vector<vector<Movable_type>> getMapData();

	//! \briefReturns Dig Dugs Position as a Point
	Point getDigdugPosition();

	//! \briefReturns the Monsters Positinos as a vector of points. 
	vector <Point> getMonstersPosition();
	

private:	
	ifstream mapfile;		//!< CSS data for Map
	ifstream movablesfile; //!< CSS data for Movables
	
	//! \briefLoads the Objects Data from txt file, calls stringToPoint which peforms delimiting 
	void loadObjects();
	vector <string> movables_data_string;

	//! \briefConverts a a string x,y into a Point(x,y)
	Point stringToPoint(string string_line);

	//! \briefConverts strings of raw map data into a 1D vector of map elements
	//! Consists of a delimitor that breaks up data into strings 
	void mapLineToMapElements(vector<Movable_type>& line_elements, const string &string_line);

	//! \briefA simple decoder that converts raw map data [hash] and [space] into Holes and Sand
	Movable_type stringToHolesAndSand(string &s_type);

};

#endif

